QuickTime 3 Reference

| Previous | Chapter Contents | Chapter Top | Next |

Building Input Maps

The first step in creating an input map is to create a new QTAtomContainer to hold the map. You use the standard QuickTime container creation function:

QTNewAtomContainer(&inputMap);

For each source you are creating, you need to call the AddTrackReference function, which returns a reference index to the track. You will use this reference index as the ID of the reference atom you add to the input map.

The code in Listing 7 gets a reference to the track firstSourceTrack , and adds it in an atom attached to the newly created input map.

Listing 7 Adding a reference in an atom to an input map

AddTrackReference(theEffectsTrack,
                 firstSourceTrack,
                 kTrackModifierReference,
                 &referenceIndex);

QTInsertChild(inputMap,
            kParentAtomIsContainer,
            kTrackModifierInput,
            referenceIndex,
            0,
            0,
            nil,
            &inputAtom);

You now need to add the name and type of the source track to the reference atom (which has been stored in inputAtom ). Again, calling the QTInsertChild function does this, as in the following source code:

inputType = VideoMediaType;
QTInsertChild(inputMap,
            inputAtom,
            kTrackModifierType,
            1,
            0,
            sizeof(inputType),
            &inputType,
            nil);

aType = 'srcA';
QTInsertChild(inputMap,
            inputAtom,
            kEffectSourceName,
            1,
            0,
            sizeof(aType),
            &aType,
            nil);

This process is repeated for each track that will act as a source for the effect.


© 1998 Apple Computer, Inc.

| Previous | Chapter Contents | Chapter Top | Next |